﻿<%@ page isELIgnored="false"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<meta http-equiv="pragma" content="no-cache"/>   
<meta http-equiv="cache-control" content="no-cache,must-revalidate"/>  
<meta http-equiv="expires" content="0"/>  
<title>中国民族博物馆乐器知识数据库</title>
<link rel="stylesheet" type="text/css" href="plugins/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/home.css"> 
    <link rel="stylesheet" type="text/css" href="plugins/tags/jquery.tagsinput.css" />
	<link rel="stylesheet" type="text/css" href="plugins/ztree/zTreeStyle/zTreeStyle.css" />
	<link rel="stylesheet" type="text/css" href="css/functionNav.css"/>  
	<script language="JavaScript"> 
	if (window != top){
		top.location.href = location.href;
	}
	</script>
<!-- <link rel="stylesheet" type="text/css" href="zversion/resources/css/common/modal.css"> 
<link rel="stylesheet" type="text/css" href="zversion/resources/css/birth.css">    
<link rel="stylesheet" type="text/css" href="zversion/resources/others/lobibox/css/Lobibox.min.css">  -->   
<style type="text/css">
body{
	 height:100%;
	 width:100%;
	 /*background:url(img/1920x1080.jpg);*/
	 font-family: "Microsoft YaHei";
     font-size: 14px;
     overflow:hidden;  
	}
.birthmain{
	position:absolute;
	float:left;
	width:100%;
	height:100%;
	top:0px;
	left:0px;
	margin:0 auto;
	padding:0 auto;
	display:block;
	z-index:9999;
	}
.modal-header {	
    padding: 5px 15px;
    background-color: #428bca;
    color: #fff;
	}
</style>
</head>
 <body  style="padding:0px;height:100%;width:100%;sroll:no;min-width:990px;">
		<!--topheader begin-->
		<div class="topheader" >
		    <div class="topleft">
		    	<a href="javascript:displayinfo('home.jsp')" target="_parent"><img src="img/logo.png" title="系统首页" /></a>
		    </div>      
		    <div class="topright"> 
			    <ul>
<!-- 			    	<li id="idconversion "><a href="#" onclick="idconversionDialog()">兼职身份切换</a></li> -->
					<!-- <li id="emailli"><div class="emaildiv"><a href="#">邮件</a></div><div class="notreademail" >0</div></li> -->
					<!-- <li id="toDoNum"></li> -->
					<!-- <li id="emailli"><div class="emaildiv"><a href="javascript:displayinfo('')"  target="_parent">待办</a></div><div id="toDoNum" class="notreademail" ></div></li>
				    <li id="modefypass"><a href="#" onclick="changePwd()">密码修改</a></li> -->
				    <li id="logoutid"><a href="#" onclick="logout()">退出</a></li>
			    </ul>
		    
			    <div id="userinfo" class="user">
		    		<img class="click" src="img/user_04.png">
		    		<i id="useri"><a href="#" onclick="#" style="cursor:hand" title="修改个人信息" id="userName">用户名</a></i>
					<i id="department">部门</i>
		    	</div>
		    	
		    </div>
		</div>
		<!--tophead end  -->
		
		<!--maincontent start -->		
		<div class="maincontent">
			
			<!-- leftnav start -->
			<div class="leftnav">
			<div class="leftmenu">
				<ul class="page-sidebar-menu">
					<li>
					  	<span class="active"></span>
						<a title="工作台首页" class="">						
							<i class="icon-home" style="background-image: url('img/icon-home.png');"></i>
							首页
						</a>
					</li>
					<li  data-toggle= 'modal'  data-target='#menuviewid'>
					 	<span></span>
						<a title="功能导航" class="">
							<i class="icon-function" style="background-image: url('img/icon-function.png');" 
							></i>
							导航
						</a>
					</li>
				</ul>
			</div>
			
			</div>
			<!-- leftnav end -->
			<!-- center start -->
			<div class="centercontent" >
					<iframe id="iframe0" name="iframe0" frameborder="0" src="pages/query/sjjs.html" style="width: 100%;height:500px;top:88px;z-index:-1;" scrolling="auto"></iframe>
			</div>
			<!--  center end -->
		</div>
		<!-- maincontent end -->	
    

	<div class="modal fade" id="selectModal" tabindex="-2" role="dialog">
		<div class="modal-dialog" style="width: 600px;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title" id="myModalLabel"></h4>
				</div>
				<div class="modal-body">
				<table>
			       <tr>
			         <td colspan=2>
			         </td>          
			       </tr>
			       <tr>
			       <td style="width:250px">
			         <td>已选：</td>
			       </tr>
			       <tr>
			         <td>
			           <div class="treeContainer" style="border:1px solid #ccc;width:200px;height:350px;overflow-y:scroll">
			           <ul id="objectTree" class="ztree" ></ul>
			           </div>
			         </td>
			         <td  valign="top">
			           <input type="text" class="form-control" style="width:200px;height:350px;valign:top"  
			           id="selectedObject" name="selectedObject"></input>
			           </td>
			       </tr>
			     </table> 
      
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary" onclick="setSelectedObject()">确定</button> 
					<button type="button" class="btn btn-default" onclick="closeWin()">取消</button>   
				</div>
			</div>
		</div>
	</div>
	<div class="modal fade" id="menuviewid" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document" style="width: 80%;margin: 0px 0 0 35px;">
			<div class="modal-content modefix" style="width: auto;">
				<div class="modal-body" id='menudivid'>
					
				</div>
			</div>
		</div>
	</div>
	<input type=hidden id='initmenustatus' value=0/>

<script type="text/javascript" src="js/jquery-2.0.0.min.js"></script>
<script type="text/javascript" src="plugins/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="plugins/bootbox/bootbox.min.js"></script>
<script type="text/javascript" src="js/constant.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/home.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/abc/dialog.js"></script>
<script type="text/javascript" src="plugins/tags/jquery.tagsinput.js"></script>    
<script type="text/javascript" src="plugins/ztree/js/jquery.ztree.core.js"></script> 
<!-- <script type="text/javascript" src="zversion/resources/js/common/new-async.js"></script>
<script type="text/javascript" src="zversion/resources/js/common/md5.js"></script>
<script type="text/javascript" src="zversion/resources/js/common/returnPages.js"></script>
<script type="text/javascript" src="zversion/resources/others/lobibox/js/lobibox.js"></script>  --> 
<script type="text/javascript">
var emailurl ="";
var functionNavClick = '';	//功能导航点击一级菜单全局变量
$(document).ready(function(){
	setAdaptiveSize();
	var result=ajaxResult('GET',false,'loginservlet.getUser.do','');
	if(result.status=='OK'){
		$('#userName').html(result.xm);
		$('#department').html(result.jg);
	}
	window.onresize = function(){
		setAdaptiveSize();
	};
	//默认home
	$('ul.page-sidebar-menu > li').each(function(){
		if($(this).find('i').attr('class')=="icon-home"){
			$(this).css('background-color','#993333');
			$(this).find('a').css("color","#f6a339");
			$(this).find('i').css("backgroundImage","url(img/icon-home-hover.png)");
		}
	});
	$('ul.page-sidebar-menu > li').click(function(){
		removeAllStyles();
		$('ul.page-sidebar-menu > li span').removeClass("active");
		$(this).find('span').addClass("active");
		$(this).find('a').css("color","#f6a339");
		var obj=$(this).find('i');
		var cls=$(this).find('i').attr("class");
		$(this).css("background-color","#d85255");
		switch(cls){
		case "icon-home":
			$(obj).css("backgroundImage","url(img/icon-home-hover.png)");
			displayinfo('pages/query/sjjs.html');
			break;
		case "icon-function":
			$(obj).css("backgroundImage","url(img/icon-function-hover.png)");
			menuinit();
			break;
		default:
			$(obj).css("backgroundImage","url(img/icon-home-hover.png)");
			displayinfo(projectroot+'home.jsp');
		}
	});
	tagIni();
});
    
//topnav点击后更新style
$('.topnav li a').click(function(){
	alert($(this).html());
});
  	  
$(document.body).css({
		"overflow-x":"hidden",
		"overflow-y":"hidden"
});
    
    //set adpative size
function setAdaptiveSize(){
	var ww = $(window).width();
	var wh = $(window).height();
	if(ww < 990){
		ww = 990;
	}
// 		   console.log("ww="+ww+" wh="+wh);
	var width = (ww-51);		//iframe宽度铺满除左侧大菜单屏幕
	var height = (wh-91);
	$('.maincontent').width(ww);
	$('.maincontent').height(height);
	$('.centercontent').width(width);
	$('.centercontent').height(height);
	$('.leftnav').height(height);
	$('#iframe0').height(height);
}
    
function removeAllStyles(){
	$('ul.page-sidebar-menu > li').each(function(){
		$(this).css("background-color","");
		$(this).find('a').css("color","#FFF")
		var obj2=$(this).find('i');			
		var cls2=$(this).find('i').attr("class");
			switch(cls2){
			case "icon-home":
				$(obj2).css("backgroundImage","url(img/icon-home.png)");
				break;
			/* case "icon-quicknav":
				$(obj2).css("backgroundImage","url(zversion/resources/images/home/left/icon-quicknav.png)");
				break; */
			case "icon-function":
				$(obj2).css("backgroundImage","url(img/icon-function.png)");
				break;
			/* case "icon-appsys":
				$(obj2).css("backgroundImage","url(/palace/zversion/resources/images/home/left/icon-appsys.png)");
				break; */
			// case "icon-message":
			//   $(obj2).css("backgroundImage","url(/palace/zversion/resources/images/home/left/icon-message.png)");
			//   break;
			default:
				displayinfo('http://antiques.sinosoft.com:8080/antiques/zversion/pages/home.jsp');
				$(obj2).css("backgroundImage","url(/palace/zversion/resources/images/home/left/icon-home.png)");
			}
	});
} 

function verifyPwd(data){
 	if ($(data).val() != $('#newPwd1').val()) {
 		$("#changePwd_error_tips").html("两次新密码不一致，请重新输入");
 	}else{
 		$("#changePwd_error_tips").html('');
 	}
 }       

//加载用户信息
function listUserContactInfo() {
	$.ajax({
		type : 'GET',
		dataType:"json",
        cache:false,
        async:false,
		url : "/palace/user.listUserContactInfo.do",
		async:false,
		error : function() {
			alertFunc('获取用户信息失败！');
		},
		success : function(res) {
			if (res.status == "Failed") {
				$("#changePersonalInfo_error_tips").html(res.error);
			} else if (res.status == "OK") {
				$("#changePersonalInfo_error_tips").html("");
				var officeval = res.data.office;
				var homeval = res.data.home;
				var mobilephoneval = res.data.mobilephone;
				var emailval = res.data.email;
				//加载单位信息
				loadchangePersonalInfoDiv(officeval, homeval, mobilephoneval,emailval);
			}
		}
	});
}
//加载用户信息
function loadchangePersonalInfoDiv(officeval, homeval, mobilephoneval, emailval) {
	$("#office").val(officeval);
	$("#home").val(homeval);
	$("#mobilephone").val(mobilephoneval);
	$("#email").val(emailval);
}

//加载待办数量
function loadTodoNum(){
	//获取待办以及菜单
	$.ajax({
		type : 'GET',
		dataType:"json",
        cache:false,
        async:false,
		url : '/palace/jt.getJobTypesForTodo.do',
		error : function() {
			alertFunc('获取系统模块失败！');
		},
		success : function(result) {
			if (result.status == "OK") {
				var num = 0;
				var toDoHref = "http://palace.sinosoft.com:8080/palace/zversion/pages/OA/toDoTasks.html";
				$.each(result.data,function(index,item){
					num += item.NUM;
				})
				$("#toDoNum").html('<a style="color:#fff" href="javascript:displayinfo(\''+toDoHref+'\')"  target="_parent">'+num+'</a>');
			}else{
				$('.gg2_content_right').html('<p style="color:#e00000;">'+result.error+'</p>');
			}
		}
	});
}

/**
 * 删除所有通知
 * @returns {} 
 */
/* function removeAllNotify(){
	$('.lobibox-notify-wrapper-large').remove();
} */

function showpage(url){
	$('#menuviewid').modal('hide');
	displayinfo(url);
}

function menuinit(){
	var menustatus = $("#initmenustatus").val();
	if(menustatus==1){
		return;
	}
		$.ajax({
		type : 'GET',
		dataType:"json",
		cache:false,
		async:false,
		url : "/cnmuseum/accessControlServlet.getAccessBar.do",
		error : function() {
			alertFunc('用户菜单信息失败！');
		},
		success : function(res) {
			if (res.status == "OK") {
				var menus = res.menu;
				var divhtml = "<div class='function_mainbox'>";
				var left_divhtml = "<div class='function_left'>";
				var right_divhtml = "<div class='function_right' style='overflow-y:auto;'>";
				for(var i=0;i<menus.length;i++){
					var menuobj = menus[i];
					var menuname = menuobj.menuName;
					left_divhtml+="<div class='function_left_modules'>"
										+"<a href='#dataCollect'>"+menuname+"</a>"
									+"</div>";

					var menuList = menuobj.menuList;
					right_divhtml+="<div class='function_right_specific' id='dataCollect'>"
										+"<div class='specific_top'>"
										+"<a href='#'><img src='"+menuList[0].imgpath+"'>"+menuname+"</a>"
										+"</div>";
					right_divhtml+=	  "<div class='specific_line'></div>"
										+"<div class='specific_real'>"
										+"<ul>";
					for(var j=0;j<menuList.length;j++){
						right_divhtml+=		"<li><a href='#' onclick='showpage(\""+menuList[j].url+"\")' >"+menuList[j].name+"</a></li>";
					}
					right_divhtml+="</ul></div></div>";
				}
				right_divhtml+="</div>";
				left_divhtml+="</div>";
				divhtml+=left_divhtml+right_divhtml+"</div>";
				//console.log(divhtml);
				$("#menudivid").html(divhtml);
				$("#initmenustatus").val(1);
				//document.write(divhtml);
			}else if (res.status == "Failed") {
				window.href = "entry.html";
			}
		}
	});
}
menuinit();
</script>
</body> 
</html>
